'''
Created on Oct 12, 2013

@author: priya
'''

class Word(object):
    '''
    classdocs
    '''
    
    '''
    Details of the word string 
    Column 1
  1 ID: word identifiers in the sentence

  Columns 2--8: words and morphosyntactic information
  2 TOKEN: word forms 
  3 LEMMA: word lemmas (gold standard manual annotation)
  4 PLEMMA: word lemmas predicted by an automatic analyzer 
  5 POS: coarse part of speech 
  6 PPOS: same as 5 but predicted by an automatic analyzer
  7 FEAT: morphological features (part of speech type, number, gender,
         case, tense, aspect, degree of comparison, etc., separated by
         the character "|")
  8 PFEAT: same as 7 but predicted by an automatic analyzer 

  Columns 9--12: syntactic dependency tree
  9 HEAD: for each word, the ID of the syntactic head ('0' if the word
         is the root of the tree)
  10 PHEAD: same as 9 but predicted by an automatic analyzer 
  11 DEPREL: dependency relation labels corresponding to the
           dependencies described in 9 ("sentence" if the word is the
           root of the tree)
  12 PDEPREL: same as 11 but predicted by an automatic analyzer 

  Columns 13--14: Named entities 
  13 NE: named entities
  14 PNE: same as 13 but predicted by a named entity recognizer

  Columns 15--16+N+M: semantic role labeling
  15 PRED: predicates are marked and annotated with a semantic class label 
  16 PPRED: Same as 15 but predicted by an automatic analyzer   
  * APREDs: N columns, one for each predicate in 15, containing the
           semantic roles/dependencies of each particular predicate
  * PAPREDs: M columns, one for each predicate in 16, with the same
            information as APREDs but predicted with an automatic analyzer.

  Last column: output to be predicted
  * COREF: coreference annotation in open-close notation, using "|" to
          separate multiple annotations (see more details below)

    '''
    id = None
    token = None
    lemma = None
    plemma = None
    pos = None
    ppos = None
    feat = None
    pfeat = None
    head = None
    phead = None
    deprel = None
    pdeprel = None
    ne = None
    pne = None
    pred = None
    ppred = None
    coref= None
    
    mentionIds = []
    sentenceId = None
    docId = None


    def __init__(self,params):
        '''
        Constructor
        '''
        
    
    def add(self,wordString):
        wordArray = wordString.split("\t")
        self.id = int(wordArray[0])
        self.token = wordArray[1]
        self.lemma = wordArray[2]
        self.plemma = wordArray[3]
        self.pos = wordArray[4]
        self.ppos = wordArray[5]
        self.feat = wordArray[6]
        self.pfeat = wordArray[7]
        self.head = wordArray[8]
        self.phead = wordArray[9]
        self.deprel = wordArray[10]
        self.pdeprel = wordArray[11]
        self.ne = wordArray[12]
        self.pne = wordArray[13]
        
        # need to do something about apreds and papreds. 
        
        self.coref = wordArray[-1].split('|')
        
        # should i throw error if there isnt atleast 17 fields? 
        
    def markMentions(self,mentionArray):
        self.mentionIds = mentionArray
        
    def markSentence(self,sentenceId):
        self.sentenceId = sentenceId
        
    def markDocument(self,docId):
        self.docId = docId
    
        
        
        
        
        
        
        
        
        
        